namespace Trading.IBApi

open com.ib.client
open System

module ContractExtensions = 
    type Contract with
        static member Option(underlying, expiry : DateTime, strike, right) = 
            Contract(
                m_symbol = underlying, 
                m_expiry = expiry.ToString("yyyyMMdd"), 
                m_strike = strike, 
                m_right = right, 
                m_exchange = "SMART", 
                m_secType = "OPT"
            )

        static member Call(underlying, expiry, strike) = Contract.Option(underlying, expiry, strike, "C")
        static member Put(underlying, expiry, strike) = Contract.Option(underlying, expiry, strike, "P")

